package controller;


import service.AtmService;
import util.MySpring;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Inquiry  extends HttpServlet {
    AtmService atmService = MySpring.getBean("service.AtmService");

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("Inquiry.service");
        String name6 = req.getParameter("name5");
        Float balance = atmService.inquiry(name6);
        req.setAttribute("balance", balance);
        req.getRequestDispatcher("showBalance.jsp").forward(req, resp);
    }
}
